from enum import Enum
from pydantic import BaseModel,ConfigDict
from typing import Optional, Dict, Any

class InputType(str, Enum):
    VIDEO_STREAM = "video_stream"
    AUDIO_STREAM = "audio_stream"
    TEXT_STREAM = "text_stream"
    IMAGE_FILE = "image_file"
    AUDIO_FILE = "audio_file"
    VIDEO_FILE = "video_file"
    TEXT_FILE = "text_file"
    FILE = "file"

class OutputType(str, Enum):
    TEXT_STREAM = "text_stream"
    AUDIO_STREAM = "audio_stream"
    VIDEO_STREAM = "video_stream"
    IMAGE_FILE = "image_file"
    AUDIO_FILE = "audio_file"
    VIDEO_FILE = "video_file"
    TEXT_FILE = "text_file"
    FILE = "file"

class MediaType(str, Enum):
    TEXT = "text/plain"
    JSON = "application/json"
    AUDIO = "audio/mpeg"
    VIDEO = "video/mp4"
    IMAGE = "image/jpeg"
    OCTET_STREAM = "application/octet-stream"

class StreamConfig(BaseModel):
    input_type: InputType
    output_type: OutputType
    model_name: str
    endpoint: Optional[str] = None
    media_type: Optional[MediaType] = MediaType.OCTET_STREAM
    params: Optional[Dict[str, Any]] = None
    model_config = ConfigDict(protected_namespaces=())  # 禁用保护命名空间